#ifndef INFINITY_MANAGED_GAME_OBJECT_INL
#	define INFINITY_MANAGED_GAME_OBJECT_INL

namespace infinity {

template< class Manager >
/*virtual*/ void ManagedGameObject< Manager >::renderDebug()
{
	;
}

template< class Manager >
inline bool ManagedGameObject< Manager >::isReadyForSimulation() const
{
	return m_simulationState == State_Initialized;
}

template< class Manager >
inline bool ManagedGameObject< Manager >::isReadyForMedia() const
{
	return m_mediaState == State_Initialized;
}

template< class Manager >
inline bool ManagedGameObject< Manager >::needsSimulationInitialization() const
{
	return m_simulationState == State_Invalid || m_simulationState == State_Initializing;
}

template< class Manager >
inline bool ManagedGameObject< Manager >::needsMediaInitialization() const
{
	return m_mediaState == State_Invalid || m_mediaState == State_Initializing;
}

template< class Manager >
inline bool ManagedGameObject< Manager >::needsSimulationTermination() const
{
	return m_simulationState != State_Terminated;
}

template< class Manager >
inline bool ManagedGameObject< Manager >::needsMediaTermination() const
{
	return m_mediaState != State_Terminated;
}

template< class Manager >
inline ManagedGameObject< Manager >::ManagedGameObject()
:	m_simulationState(State_Invalid)
,	m_mediaState(State_Invalid)
{
}

template< class Manager >
/*virtual*/ inline ManagedGameObject< Manager >::~ManagedGameObject()
{
}

template< class Manager >
/*virtual*/ inline ManagedGameObjectBase::State ManagedGameObject< Manager >::onInitializeSimulation()
{
	return State_Initialized;
}

template< class Manager >
/*virtual*/ inline void ManagedGameObject< Manager >::onUpdateSimulation(dw::float32 deltaT)
{
	;
}

template< class Manager >
/*virtual*/ inline ManagedGameObjectBase::State ManagedGameObject< Manager >::onTerminateSimulation()
{
	return State_Terminated;
}

template< class Manager >
/*virtual*/ inline ManagedGameObjectBase::State ManagedGameObject< Manager >::onInitializeMedia()
{
	return State_Initialized;
}

template< class Manager >
/*virtual*/ inline void ManagedGameObject< Manager >::onUpdateMedia(dw::float32 deltaT)
{
}

template< class Manager >
/*virtual*/ inline ManagedGameObjectBase::State ManagedGameObject< Manager >::onTerminateMedia()
{
	return State_Terminated;
}
	
template< class Manager >
inline void ManagedGameObject< Manager >::initializeSimulation()
{
	dwAssert(m_simulationState == State_Invalid || m_simulationState == State_Initializing, "Invalid internal State");

	m_simulationState = onInitializeSimulation();
}

template< class Manager >
inline void ManagedGameObject< Manager >::updateSimulation(dw::float32 deltaT)
{
	dwAssert(m_simulationState == State_Initialized, "Invalid internal State");

	onUpdateSimulation(deltaT);
}

template< class Manager >
inline void ManagedGameObject< Manager >::terminateSimulation()
{
	m_simulationState = onTerminateSimulation();

	dwAssert(m_simulationState == State_Terminating || m_simulationState == State_Terminated, "Invalid internal state");
}

template< class Manager >
inline void ManagedGameObject< Manager >::initializeMedia()
{
	dwAssert(m_mediaState == State_Invalid || m_mediaState == State_Initializing, "Invalid internal State");

	m_mediaState = onInitializeMedia();
}

template< class Manager >
inline void ManagedGameObject< Manager >::updateMedia(dw::float32 deltaT)
{
	dwAssert(m_mediaState == State_Initialized, "Invalid internal State");

	onUpdateMedia(deltaT);
}

template< class Manager >
inline void ManagedGameObject< Manager >::terminateMedia()
{
	m_mediaState = onTerminateMedia();

	dwAssert(m_mediaState == State_Terminating || m_simulationState == State_Terminated, "Invalid internal state");
}

} // namespace infinity

#endif // !INFINITY_MANAGED_GAME_OBJECT_INL
